package com.ruibang.glass.equipment.feign;

import com.ruibang.glass.common.domain.camunda.*;
import com.teaming.cloud.framework2.common.model.ResultBody;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.Collection;
import java.util.List;

@FeignClient("glass-camunda")
@Component
public interface CamundaApi {
    @RequestMapping(value = "/api/bpm/process-instance/create",method = RequestMethod.POST)
    ResultBody<String> createProcessInstance(@RequestBody BpmProcessInstanceCreate bpmProcessInstanceCreate, @RequestHeader("token") String token);

    @RequestMapping(value = "/api/bpm/task/changeTaskAssignee",method = RequestMethod.POST)
    ResultBody changeTaskAssignee(@RequestBody BpmTaskChangeAssigneeReq bpmTaskChangeAssigneeReq);

    @RequestMapping(value = "/api/bpm/task-assign-rule/changeProcessDefinitionRule",method = RequestMethod.POST)
    ResultBody changeProcessDefinitionRule(@RequestBody ProcessRuleChangeReq processRuleChangeReq);

    @RequestMapping(value = "/api/bpm/process-instance/queryProcessInstanceStatus",method = RequestMethod.POST)
    ResultBody<List<BpmProcessInstanceStatus>> queryProcessInstanceStatus(@RequestBody Collection<String> businessKeys);

    @RequestMapping(value = "/api/bpm/process-definition/getProcessDefinitionId/{menuId}",method = RequestMethod.GET)
    ResultBody<String> getProcessDefinitionId(@PathVariable("menuId") String menuId);


    @RequestMapping(value = "/api/bpm/process-instance/getProcessNodeById/{processInstanceId}",method = RequestMethod.GET)
    ResultBody<String> getProcessNodeById(@PathVariable("processInstanceId") String processInstanceId);

    @RequestMapping(value = "/api/bpm/process-instance/getProcessNodeByBusinessId/{businessId}",method = RequestMethod.GET)
    ResultBody<String> getProcessNodeByBusinessId(@PathVariable("businessId") String businessId);

    @RequestMapping(value = "/api/bpm/task/approveBusinessTask",method = RequestMethod.POST)
    ResultBody approve(@RequestBody BpmTaskApproveReq bpmTaskApproveReq);


}
